<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>企业展示</title>

    <!-- 引入头文件 -->
    <include file="claim" />

</head>
<body>
<div class="container">
    
<!-- 引入巨幕文件 -->
<include file="jumbotron" />

<!-- 引入导航文件 -->
<include file="nav" />

<!-- 正文开始 -->
<div class="row clearfix">
    
    <!-- 引入左侧边栏 -->
    <include file="aside" />
    
    <div class="col-md-10 column">
        <div class="col-md-12 column">
            <div class="row clearfix">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>
                                序&#160;&#160;&#160;&#160;号
                            </th>
                            <th>
                                称&#160;&#160;&#160;&#160;呼
                            </th>
                            <th>
                                联系方式
                            </th>
                            <th>
                                时&#160;&#160;&#160;&#160;间
                            </th>
                            <th>
                                内容摘要
                            </th>
                            <th>
                                操&#160;&#160;&#160;&#160;作
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                    <if condition="$msglist eq []">
                    <tr>
                        <td colspan="6" style="color: red;text-align: center;">暂无记录！</td>
                    </tr>
                    <else />
                    <foreach name="msglist" item="m">
                        <tr>
                            <td>
                                {++$tmp}
                            </td>
                            <td>
                                {$m['msg_name']}
                            </td>
                            <td>
                                {$m['msg_contact']}
                            </td>
                            <td>
                                {$m['msg_addtime']|date="Y/m/d H:i:s", ###}
                            </td>
                            <td>
                                {$m['msg_content']|substr=0,6}...
                            </td>
                            <td>
                                <a href="{:U('/admin/company/msgview', array('msg_id'=>$m['msg_id']))}">查看</a> | 
                                <!-- 开始遮罩{$m['msg_id']} -->
                                <a href="#" class="text-danger" data-toggle="modal" data-target="#myModal{$m['msg_id']}">删除</a>
                                <!-- 模态框（Modal） -->
                                <div class="modal fade" id="myModal{$m['msg_id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                                <h4 class="modal-title" id="myModalLabel">删前确认</h4>
                                            </div>
                                            <div class="modal-body">你确定删除该条留言吗，此操作不可恢复？</div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                <a type="button" class="btn btn-primary" href="{:U('/admin/company/msgdel', array('msg_id'=>$m['msg_id']))}">删除</a>
                                            </div>
                                        </div><!-- /.modal-content -->
                                    </div><!-- /.modal -->
                                </div>
                                <!-- 结束遮罩 -->
                            </td>
                        </tr>
                    </foreach>
                    </if>
                    </tbody>
                </table>
                <if condition="$msglist neq []">
                <!-- 开始遮罩清空留言 -->
                <button class="btn btn-danger pull-right" data-toggle="modal" data-target="#myModal">清空留言</button>
                <!-- 模态框（Modal） -->
                <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title" id="myModalLabel">清空确认</h4>
                            </div>
                            <div class="modal-body">你确定清空所有留言吗，该操作将会把所有留言一次性清除且此操作不可恢复？</div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <a type="button" class="btn btn-primary" href="{:U('/admin/company/msgdel', array('msg_id'=>-1))}">删除</a>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal -->
                </div>
                <!-- 结束遮罩清空留言 -->
                </if>
            </div>
        </div>
    </div>
</div>
<!-- 正文结束 -->

<!-- 引入页脚文件 -->
<include file="footer" />

</div>
</body>
    
<!-- 引入尾文件 -->
<include file="js" />

<!-- 页面独有脚本 -->
<script>
    // 检索侧边栏点击状态并更改为当前页
    $('li:contains(留言列表)')[0].className = 'active';
</script>
</html>